#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
inline int read(){
	int x = 0, f = 1; char c = getchar();
	while(c < '0' || c > '9'){if(c == '-')f = -1; c = getchar();}
	while(c >= '0' && c <= '9'){x = (x << 1) + (x << 3) + c - '0'; c = getchar();}
	return x * f;
}
int n, l, r, ans;
int main(){
	freopen("candy.in", "r", stdin);
	freopen("candy.out", "w", stdout);
	n = read(), l = read(), r = read();
	ans = n * (r / n);
	if(ans > l){
		printf("%d", n - 1);
	}
	else{
		printf("%d", r - ans);
	}
	return 0;
}
